﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Speech.Recognition;
using System.Text;
using System.Globalization;


namespace speech
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

          
            /*SpeechRecognitionEngine RecognitionEngine = new SpeechRecognitionEngine();
            RecognitionEngine.SetInputToDefaultAudioDevice();
             RecognitionEngine.LoadGrammar(new DictationGrammar());
           RecognitionResult Result = RecognitionEngine.Recognize();

             StringBuilder Output = new StringBuilder();
             foreach (RecognizedWordUnit Word in Result.Words)
             {
                  Output.Append(Word.Text);
              }*/
            //CultureInfo culture = new CultureInfo("en-GB");

            // Create a new SpeechRecognitionEngine instance.
            /*SpeechRecognizer recognizer = new SpeechRecognizer();

            // Create a simple grammar that recognizes "red", "green", or "blue".
            Choices colors = new Choices();
            colors.Add(new string[] { "red", "green", "blue", "yellow" });

            // Create a GrammarBuilder object and append the Choices object.
            GrammarBuilder gb = new GrammarBuilder();
            gb.Append(colors);

            // Create the Grammar instance and load it into the speech recognition engine.
            Grammar g = new Grammar(gb);
            recognizer.LoadGrammar(g);

            // Register a handler for the SpeechRecognized event.
            recognizer.SpeechRecognized +=
              new EventHandler<SpeechRecognizedEventArgs>(sre_SpeechRecognized);*/

        }


      // void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
       // {
           //Label1.Text = "Speech recognized: " + e.Result.Text;
            //Response.Write("Speech recognized: " + e.Result.Text);
        //}
    }

}